package com.wr.springbootadmin.common;

/**
 * @author 王瑞
 * @description: 自定义枚举
 * @date 2020/12/24  15:40
 */
public enum ResultCode {

    /*
    成功
    * */
    SUCCESS(200, "success"),


    // 系统错误
    SERVICE_ERROR(500, "service error"),

    PATH_NOT_FOUND(404, "路径不存在，请检查路径"),

    DUPLICATE_KEY(501, "数据库中已存在该记录"),
    TOKEN_GENERATOR_ERROR(502, "token生成失败"),
    NO_UUID(503, "uuid为空"),
    SQL_ILLEGAL(504, "sql非法"),

    //用户权限错误
    INVALID_TOKEN(1001, "无访问权限，token不合法,或则已过期"),
    INVALID_CERTIFICATE(1002, "无访问权限，不正确的凭证"),
    INVALID_EXPIRED(1003, "无访问权限，token凭证过期"),
    MULTIPLE_ONLOGIN(1004, "多个用户同时登录"),
    UNKNOWN_ACCOUNT(1005, "账号或者密码错误"),
    EXCESSIVE_ATTEMPTS(1006, "认证次数超过限制"),
    DISABLED_ACCOUNT(1007, " 禁用的账号"),
    LOCKED_ACCOUNT(1008, " 账号被锁定"),
    TOKEN_ISNULL(1009, "无访问权限，token授权码为空"),

    UNAUTHORIZED(10011, "无访问权限，未授权"),
    UNANTHENTICATED(10012, "无访问权限，未认证或者未登录"),

    ;


    private Integer code;

    private String message;


    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
